# -*- coding: utf-8 -*-
import xadmin
from xadmin import views
from xadmin.layout import Fieldset, Main, Side, Row
from .models import *
from user.models import Clerk
# class ××××Admin(object):
#     # xadmin plugin
#     list_display = []
#     searchfields = []  # 搜索该类的外键字段 fk__attribute student__name
#     list_filter = []
#     ordering = ["-"]  # 默认排序方式 点击字段都可正序/倒序排列
#     readonly_fields = []
#     exclude = [] # include相对，与readonly_fields冲突
#     relfield_style = "fk-ajax"  #  作为其他类引用的外键不再是直接下拉显示全部对象的__str__方法返回的字符串，而是显示含搜索内容的字段
#     list_editable = []  # 可以在列表页中直接编辑
#     inlines = []  # 引用该类的类，本类作为外键，外键为一，一对多
#     refresh_times = [3,5]  # 单位秒
# xadmin.site.register(××××,××××Admin)

# Course的admin管理器


class StoreAdmin(object):
    list_display = [field.name for field in Store._meta.fields]
    style_fields = {'user_permissions': 'm2m_transfer', "info": "ueditor"}
    # hidden_menu = True

    # class ClerkInline(object):
    #     model = Clerk
    #     # exclude = ['', ]
    #     extra = 1
    #     style = 'tab'

    # inlines = [ClerkInline,]


xadmin.site.register(Store, StoreAdmin)
